import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: 'login',
        component: () => import('../views/LoginView')
    },
    {
        path: '/home',
        name: 'home',
        component: HomeView
    },
    {
        path: '/about',
        name: 'about',
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
    },
    {
        path: '/login',
        name: 'logina',
        component: () => import('../views/Login.vue'),
        children: [
            {
                path: '/loginByPassword',
                name: 'LoginByPassword',
                component: () => import('../views/LoginByPassword')
            },
            {
                path: '/loginBySms',
                name: 'loginBySms',
                component: () => import('../views/LoginSms')
            }
        ]
    },
    {
        path: '/register/:username/:password',
        name: 'register',
        component: () => import('../views/Register.vue')
    },
    {
        path: '/layout',
        name: 'layout',
        component: () => import('../views/element-ui/LayoutView')
    },
    {
        path: '/button',
        name: 'button',
        component: () => import('../views/element-ui/ButtonView')
    },
    {
        path: '/axios1',
        name: 'axios1',
        component: () => import('../views/axios-view/C1AxiosView')
    },
    {
        path: '/axios2',
        name: 'axios2',
        component: () => import('../views/axios-view/C2AxiosView')
    },
    {
        path: '/axios3',
        name: 'axios3',
        component: () => import('../views/axios-view/C3AxiosView')
    },
    {
        path: '/axios4',
        name: 'axios4',
        component: () => import('../views/axios-view/C4AxiosView')
    },


    {
        path: '/emp',
        name: 'emp',
        component: () => import('../views/emp/empView')
    }
]

const router = new VueRouter({
  routes
})

export default router
